/**
 * arkcube script language service
 */
import { LanguageService, ILogger, Capabilities, CompletionItemCapabilities, FormatterSettings } from './service';
import { TextDocument } from 'vscode-languageserver-textdocument'; 
import {
    Position, CompletionItem, Range, CodeActionContext, Command, TextDocumentIdentifier, SemanticTokens, Location, DocumentHighlight, SymbolInformation, SignatureHelp, DocumentLink, TextEdit, Hover, FormattingOptions, Diagnostic, MarkupKind, FoldingRange, CompletionItemTag
} from "vscode-languageserver-types";


import { ValidatorSettings } from '../utils/utils';



export class ArksLanguageService implements LanguageService {

	private foldingRangeLineFoldingOnly: boolean = false;
    private foldingRangeLimit: number = Number.MAX_VALUE;
    public setLogger(logger: ILogger): void {
    }

	public setCapabilities(capabilities: Capabilities): void {
        
    }

	public computeCodeActions(textDocument: TextDocumentIdentifier, range: Range, context: CodeActionContext): Command[] {
        // let dockerCommands = new DockerCommands();
        // return dockerCommands.analyzeDiagnostics(context.diagnostics, textDocument.uri);
		return [];
    }

    public computeLinks(content: string): DocumentLink[] {
        // let dockerLinks = new DockerLinks();
        // return dockerLinks.getLinks(content);
		return [];
    }

    public resolveLink(link: DocumentLink): DocumentLink {
        // let dockerLinks = new DockerLinks();
        // return dockerLinks.resolveLink(link);
		return {
			range: {
				start: {
					line: 0,
					character: 0
				},
				end: {
					line: 0,
					character: 0
				}
			}
		};
    }

    public computeCommandEdits(content: string, command: string, args: any[]): TextEdit[] {
        // let dockerCommands = new DockerCommands();
        // return dockerCommands.computeCommandEdits(content, command, args);
		return [];
    }

    public computeCompletionItems(content: string, position: Position): CompletionItem[] | PromiseLike<CompletionItem[]> {
        // const document = TextDocument.create("", "", 0, content);
        // const dockerAssist = new DockerAssist(document, new DockerRegistryClient(this.logger), this.completionItemCapabilities);
        // return dockerAssist.computeProposals(position);
		return [];
    }

    public resolveCompletionItem(item: CompletionItem): CompletionItem {
        // if (!item.documentation) {
        //     let dockerCompletion = new DockerCompletion();
        //     return dockerCompletion.resolveCompletionItem(item, this.completionItemCapabilities && this.completionItemCapabilities.documentationFormat);
        // }
        // return item;
		return {
			label: ''
		};
    }

    public computeDefinition(textDocument: TextDocumentIdentifier, content: string, position: Position): Location {
        // let dockerDefinition = new DockerDefinition();
        // return dockerDefinition.computeDefinition(textDocument, content, position);
		return {
			uri: '',
			range: {
				start: {
					line: 0,
					character: 0
				},
				end: {
					line: 0,
					character: 0

				}
			}
		};
    }

    public computeFoldingRanges(content: string): FoldingRange[] {
        // let dockerFolding = new DockerFolding();
        // return dockerFolding.computeFoldingRanges(content, this.foldingRangeLineFoldingOnly, this.foldingRangeLimit);
		return [];
    }

    public computeHighlightRanges(content: string, position: Position): DocumentHighlight[] {
        // let dockerHighlight = new DockerHighlight();
        // return dockerHighlight.computeHighlightRanges(content, position);
		return [];
    }

    public computeHover(content: string, position: Position): Hover | null {
        // let dockerHover = new DockerHover(this.markdownDocumentation, this.plainTextDocumentation);
        // return dockerHover.onHover(content, position, this.hoverContentFormat);
		return null;
    }

    public computeSymbols(textDocument: TextDocumentIdentifier, content: string): SymbolInformation[] {
        // let dockerSymbols = new DockerSymbols();
        // return dockerSymbols.parseSymbolInformation(textDocument, content);
		return [];
    }

    public computeSignatureHelp(content: string, position: Position): SignatureHelp {
        // let dockerSignature = new DockerSignatures();
        // return dockerSignature.computeSignatures(content, position);
		return {
			signatures: []
		};
    }

    public computeRename(textDocument: TextDocumentIdentifier, content: string, position: Position, newName: string): TextEdit[] {
        // let dockerRename = new DockerRename();
        // return dockerRename.rename(textDocument, content, position, newName);
		return [];
    }

    public prepareRename(content: string, position: Position): Range | null {
        // let dockerRename = new DockerRename();
        // return dockerRename.prepareRename(content, position);
		return null;
    }

    public computeSemanticTokens(content: string): SemanticTokens {
        // let dockerSemanticTokens = new DockerSemanticTokens(content);
        // return dockerSemanticTokens.computeSemanticTokens();
		return {
			data: []
		};
    }

    public validate(content: string, settings?: ValidatorSettings): Diagnostic[] {
        // return DockerfileUtils.validate(content, settings);
		return [];
    }

    public format(content: string, settings: FormatterSettings): TextEdit[] {
        // return DockerfileUtils.format(content, settings);
		return [];
    }

    public formatRange(content: string, range: Range, settings: FormatterSettings): TextEdit[] {
        // return DockerfileUtils.formatRange(content, range, settings);
		return [];
    }

    public formatOnType(content: string, position: Position, ch: string, settings: FormatterSettings): TextEdit[] {
        // return DockerfileUtils.formatOnType(content, position, ch, settings);
		return [];
    }
}